package com.supermarket.api.repository;

import com.supermarket.api.entity.UserInfoEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * 用户相关
 * @author 李其伟
 * @date 2023/10/29
 */
@Repository
public interface UserInfoRepository extends JpaRepository<UserInfoEntity, Long> {

    /**
     * 根据手机号查询
     * @param phone
     * @return
     */
    UserInfoEntity findAllByPhone(String phone);

    /**
     * 根据登陆名称查询
     * @param loginName
     * @return
     */
    UserInfoEntity findAllByLoginName(String loginName);

    /**
     * 根据邮箱名称查询
     * @param email
     * @return
     */
    UserInfoEntity findAllByEmail(String email);
}